package com.epam.training.concurrency.second.task5;

import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.locks.Lock;

public class Account {

	private Integer account;
	private Lock lock = new ReentrantLock();

	public Account() {
		account = 0;
	}

	public Account(int amount) {
		account = amount;
	}

	public int checkAccount() {
		return account;
	}

	public void withdraw(int amount) {
		account -= amount;
	}

	public void deposit(int amount) {
		account += amount;
	}

	public Lock getLock() {
		return lock;
	}

}
